package test;

public class test1 {
    public static void main(String[] args) {

        //求出年度总营业额
        int[][] yearArrArr={
                {22,66,44},
                {77,33,88},
                {25,67,64},
                {32,26,84}
        };
        int yearsum=0;
        for (int i = 0; i < yearArrArr.length; i++) {
            int[] quartArr=yearArrArr[i];

            int sum =getsum(quartArr);
            System.out.println("第"+i+"个季度的总营业额为："+sum);
            yearsum+=sum;
        }
        System.out.println("全年总营业额为："+yearsum);
    }

    private static int getsum(int[] quartArr) {
        int sum=0;
        for (int i = 0; i < quartArr.length; i++) {
            sum+=quartArr[i];
        }
        return sum;
    }
}
